﻿using System;
using System.Collections;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using BLL.Util;

namespace MZ.server
{
    /// <summary>
    /// Ajax获取信息
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class InfoHandler : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "application/json";
            var id = context.Request["id"];
            switch (context.Request["info"])
            {
                case "rate":
                    var rate = Config.GetRateByID(int.Parse(id));
                    rate.Rate *= 100;//js计算有bug改用服务代码转换成%制
                    var json = Json.ConvertToJson(rate);
                    context.Response.Write(json);
                    break;
                default:
                    break;
            }
           
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}
